feat(service-ai)!: rename data agent data_chat → ask (Path A) with back-compat alias#2144
Merged
Conversation
…lias The platform data agent's identifier is renamed so the friendly console URL equals the real name (/ai/ask). Back-compat is preserved: - DEFAULT_DATA_AGENT_NAME = 'ask' (was 'data_chat'); LEGACY_DATA_AGENT_NAME kept for migrations/diagnostics. - New process-wide alias registry (agent-aliases.ts): seeds data_chat->ask; AgentRuntime.loadAgent normalizes a requested name through it, so /agents/data_chat/chat and persisted agent_id='data_chat' keep resolving. Exposes registerAgentAlias() so other packages register their OWN renames (cloud AI Studio: metadata_assistant->build) — keeping the two renames decoupled and independently safe; no alias points at an unregistered id. - Aliases are resolution-only (not records), so GET /ai/agents still lists each agent once. On upgrade, the plugin prunes the stale 'data_chat' registry entry so the catalog isn't doubled. Unit-tested: alias table + loadAgent legacy resolution (5 cases). The objectui console already resolves both legacy and renamed catalogs (its agentAliases layer is verified live), so no client change is required. BREAKING CHANGE: the built-in data agent's canonical name is now 'ask'. The legacy 'data_chat' name remains accepted via the alias table. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
git add -A swept in local worktree node_modules symlinks (the repo .gitignore matches node_modules/ as a dir, not a symlink), which broke CI install (ENOTDIR). Untracked; functionally inert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
chatbot-features: catalog/loadAgent/agent-spec now assert canonical 'ask'; legacy '/agents/data_chat/chat' POST tests kept as back-compat (resolve via alias). 83 AI tests pass locally. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Part of the Path A console AI surface split (objectui#1868): the two assistants get their own pages at friendly routes
/ai/askand/ai/build. For the route to equal the real identifier (no permanent alias-indirection layer), the built-in agents are renamed. This PR renames the framework's data agentdata_chat→ask. The cloud rename (metadata_assistant→build) is a separate PR; this one is independently safe.What
DEFAULT_DATA_AGENT_NAME = 'ask'(wasdata_chat);LEGACY_DATA_AGENT_NAMEkept for migrations/diagnostics.agents/agent-aliases.ts): seedsdata_chat → ask;AgentRuntime.loadAgentnormalizes a requested name through it, so/agents/data_chat/chatand any persistedai_conversations.agent_id = 'data_chat'keep resolving. Aliases are resolution-only (not records), soGET /ai/agentsstill lists each agent once.registerAgentAlias(legacy, canonical)is exported so each package registers its own rename — the cloud AI Studio plugin will registermetadata_assistant → build. This decoupling is what makes the two renames independently safe: neither alias points at an id its owning package hasn't registered yet.data_chatregistry entry so the catalog isn't doubled (idempotent on fresh installs).Verification
loadAgentresolving a legacy name to the renamed record + unknown-name passthrough.agentAliaseslayer was verified live against this rig and is unit-tested), so no client change is required by this PR.tscerrors exist in some__tests__files onmain; none are touched here.Breaking change
The built-in data agent's canonical name is now
ask. The legacydata_chatname remains accepted via the alias table, so existing clients/links/conversations keep working.Related / follow-ups
ask/build).service-ai-studio: renamemetadata_assistant→build(+registerAgentAlias), update the Studio appdefaultAgent.ai_conversations.agent_idold→new (not required for function — aliases handle legacy values).🤖 Generated with Claude Code